Optimal. Leaf size=57 \[ -i \text {Li}_2\left (-i e^{i x}\right )+i \text {Li}_2\left (i e^{i x}\right )+2 x \sin (x)+2 \cos (x)+2 i x \tan ^{-1}\left (e^{i x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.875, Rules used = {4431, 3296, 2638, 4407, 4181, 2279, 2391} \[ -i \text {PolyLog}\left (2,-i e^{i x}\right )+i \text {PolyLog}\left (2,i e^{i x}\right )+2 x \sin (x)+2 \cos (x)+2 i x \tan ^{-1}\left (e^{i x}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2279
Rule 2391
Rule 2638
Rule 3296
Rule 4181
Rule 4407
Rule 4431
Rubi steps
\begin {align*} \int x \cos (2 x) \sec (x) \, dx &=\int (x \cos (x)-x \sin (x) \tan (x)) \, dx\\ &=\int x \cos (x) \, dx-\int x \sin (x) \tan (x) \, dx\\ &=x \sin (x)+\int x \cos (x) \, dx-\int x \sec (x) \, dx-\int \sin (x) \, dx\\ &=2 i x \tan ^{-1}\left (e^{i x}\right )+\cos (x)+2 x \sin (x)+\int \log \left (1-i e^{i x}\right ) \, dx-\int \log \left (1+i e^{i x}\right ) \, dx-\int \sin (x) \, dx\\ &=2 i x \tan ^{-1}\left (e^{i x}\right )+2 \cos (x)+2 x \sin (x)-i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )+i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )\\ &=2 i x \tan ^{-1}\left (e^{i x}\right )+2 \cos (x)-i \text {Li}_2\left (-i e^{i x}\right )+i \text {Li}_2\left (i e^{i x}\right )+2 x \sin (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 77, normalized size = 1.35 \[ -i \left (\text {Li}_2\left (-i e^{i x}\right )-\text {Li}_2\left (i e^{i x}\right )\right )-x \left (\log \left (1-i e^{i x}\right )-\log \left (1+i e^{i x}\right )\right )+2 x \sin (x)+2 \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.23, size = 106, normalized size = 1.86 \[ -\frac {1}{2} \, x \log \left (i \, \cos \relax (x) + \sin \relax (x) + 1\right ) + \frac {1}{2} \, x \log \left (i \, \cos \relax (x) - \sin \relax (x) + 1\right ) - \frac {1}{2} \, x \log \left (-i \, \cos \relax (x) + \sin \relax (x) + 1\right ) + \frac {1}{2} \, x \log \left (-i \, \cos \relax (x) - \sin \relax (x) + 1\right ) + 2 \, x \sin \relax (x) + 2 \, \cos \relax (x) + \frac {1}{2} i \, {\rm Li}_2\left (i \, \cos \relax (x) + \sin \relax (x)\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, \cos \relax (x) - \sin \relax (x)\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, \cos \relax (x) + \sin \relax (x)\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, \cos \relax (x) - \sin \relax (x)\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x \cos \left (2 \, x\right ) \sec \relax (x)\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 66, normalized size = 1.16 \[ x \ln \left (1+i {\mathrm e}^{i x}\right )-x \ln \left (1-i {\mathrm e}^{i x}\right )-i \dilog \left (1+i {\mathrm e}^{i x}\right )+i \dilog \left (1-i {\mathrm e}^{i x}\right )+2 \cos \relax (x )+2 x \sin \relax (x ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ 2 \, x \sin \relax (x) + 2 \, \cos \relax (x) - 2 \, \int \frac {x \cos \left (2 \, x\right ) \cos \relax (x) + x \sin \left (2 \, x\right ) \sin \relax (x) + x \cos \relax (x)}{\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.21, size = 46, normalized size = 0.81 \[ 2\,\cos \relax (x)+2\,x\,\sin \relax (x)-\mathrm {polylog}\left (2,-{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+\mathrm {polylog}\left (2,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+x\,\mathrm {atan}\left ({\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,2{}\mathrm {i} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x \cos {\left (2 x \right )} \sec {\relax (x )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________